package com.mopon.test.tx.service.impl;

import com.mopon.test.bean.User;
import com.mopon.test.tx.dao.UserDao;
import com.mopon.test.tx.service.UserService;
import com.smart.framework.ioc.annotation.Inject;
import com.smart.framework.tx.annotation.Service;
import com.smart.framework.tx.annotation.Transaction;

@Service
public class UserServiceImpl implements UserService {
	
	@Inject
	private UserDao userDao;

	@Override
	@Transaction
	public void updateUser() {
		User user = userDao.findByName("admin");
		System.out.println(user);
		user.setPassword("admin");
		userDao.updateUser(user);
		user = userDao.findByName("admin");
		System.out.println(user);
	}

}
